package com.ruoyi.index.controller;

import com.ruoyi.index.dto.CarouselDto;
import com.ruoyi.index.dto.GoodsCategoryDto;
import com.ruoyi.index.service.CarouselService;
import com.ruoyi.index.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/index/carousel")
public class CarouselController {
    @Autowired
    private CarouselService carouselService;

    @RequestMapping("/selectCarousel/{isOnline}")
    public Result selectCarousel(@PathVariable Integer isOnline){
        List<CarouselDto> carouselList = carouselService.selectCarousel(isOnline);
        return Result.success().put("carouselList",carouselList);
    }
}
